<style lang="less" scoped>
.panel {
  margin-bottom: 10px;
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    background: white;

    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    margin-bottom: 10px;
    background: white;
    padding-bottom: 10px;

    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
        width: 100px;
      }
      &-value {
        flex: 1;
        padding-left: 15px;
        color: #333;
      }
    }
  }
}
.main-pic {
  width: 400px;
  height: 200px;
}
</style>

<template>
  <div class="panel">
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">案由</div>
        <div class="panel-content__item-value">{{item.case_reason||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">案号</div>
        <div class="panel-content__item-value">{{item.case_no||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">开庭日期</div>
        <div class="panel-content__item-value">{{item.open_time||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">地区</div>
        <div class="panel-content__item-value">{{item.province||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">排期日期</div>
        <div class="panel-content__item-value">{{item.schedule_time||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">承办部门</div>
        <div class="panel-content__item-value">{{item.undertake_department||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">审判长/主审人</div>
        <div class="panel-content__item-value">{{item.chief_judge||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">上述人</div>
        <div class="panel-content__item-value">{{item.prosecutor&&item.prosecutor.name||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">被上述人</div>
        <div class="panel-content__item-value">{{item.defendant&&item.defendant.name||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">法院</div>
        <div class="panel-content__item-value">{{item.execute_gov||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">法庭</div>
        <div class="panel-content__item-value">{{item.execute_unite||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">公告内容</div>
        <div class="panel-content__item-value">{{item.content||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      item: {}
    };
  },
  onShow() {
    this.getInfos();
  },
  methods: {
    async getInfos() {
      const url = '/xcx/getCountNoticeDetail';
      const params = {
        noticeId: this.$route.query.id
      };
      const res = await this.$http.get(url, params);
      if (res.status != 200) {
        wx.showToast({
          title: res.message || '获取失败！',
          icon: 'none',
          mask: true
        });
        return;
      }
      this.item = res.result;
    }
  }
};
</script>
